﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using DataBase;
using DB.Langben;
using DB.SDFAuth;

using Nop.Core.Infrastructure;
using Nop.Services.Blogs;
using SDF.Core;
using NUnit.Framework;
using SDF.Core.Infrastructure;
using SDFAuth;
using SDFAuth.Data;
using Weapsy;

namespace Nop.Data.Tests
{
    [TestFixture]
    public class EFRepositoryTest
    {

        [SetUp]
        public void SetUp()
        {
            EngineContext.Initialize(true);
        }

        [Test]
        public void Test()
        {
            var repository = EngineContext.Current.ContainerManager.Resolve<IRepository<application>>();
            var repository2 = EngineContext.Current.ContainerManager.Resolve<IRepository<SysMenu>>();
            Assert.True(repository.Table.Any() );
            Assert.True(repository.Table.Any());
        }

        [Test]
        public void TestService()
        {
            var service = EngineContext.Current.ContainerManager.Resolve<IApplicationService>();
            Assert.NotNull(service);
            var list = service.GetAll(0,0,10);
        }

        [Test]
        public void TestService2()
        {
            var service = EngineContext.Current.ContainerManager.Resolve<ICityService>();
            Assert.NotNull(service);
            var list = service.GetProvincere();
            Assert.True(list.Count > 0);
        }

        [Test]
        public void Test2()
        {
            var repository = EngineContext.Current.ContainerManager.Resolve<IRepository<SysPerson>>();
            Assert.True(repository.Table.Any());
        }
    }
}
